﻿using System;
using System.Collections;
using System.IO;

namespace _5E.Utils.FileHelper
{
    public abstract class FileSorter : IComparer
    {
        public int Compare(object x, object y)
        {
            if (x == null && y == null)
                return 0;
            if (x == null)
                return -1;
            if (y == null)
                return 1;
            return Compare(new FileInfo(x.ToString()), new FileInfo(y.ToString()));
        }

        protected abstract Int32 Compare(FileInfo fileX, FileInfo fileY);
    }
}
